package com.adcc.loadsheet.billing.entity;

import com.adcc.loadsheet.billing.vo.ScAirportEntityVO;
import com.google.common.base.Strings;

/**
 * 机场表实体类
 * Created by zhaoml on 2020/4/13.
 */
public class ScAirportEntity extends BasisEntity<ScAirportEntityVO> {
    private Integer id;   //主键ID
    private String airportShortname;
    private String airportName;
    private String isAddContent;
    private String addContent;
    private String remark;

    @Override
    public ScAirportEntityVO toVO() {
        ScAirportEntityVO vo = new ScAirportEntityVO();
        vo.setId(this.id);
        vo.setAirportShortname(this.airportShortname);
        vo.setAirportName(this.airportName);
        vo.setIsAddContent(this.isAddContent);
        vo.setAddContent(this.addContent);
        vo.setRemark(this.remark);

        if(Strings.isNullOrEmpty(this.airportName)){
            vo.setAirportNameCut("");
        }else if(this.airportName.length() <= 4){
            vo.setAirportNameCut(this.airportName);
        }else {
            vo.setAirportNameCut(this.airportName.substring(0,4) + "...");
        }

        return vo;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getAirportShortname() {
        return airportShortname;
    }

    public void setAirportShortname(String airportShortname) {
        this.airportShortname = airportShortname;
    }

    public String getAirportName() {
        return airportName;
    }

    public void setAirportName(String airportName) {
        this.airportName = airportName;
    }

    public String getIsAddContent() {
        return isAddContent;
    }

    public void setIsAddContent(String isAddContent) {
        this.isAddContent = isAddContent;
    }

    public String getAddContent() {
        return addContent;
    }

    public void setAddContent(String addContent) {
        this.addContent = addContent;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
}